﻿#region copyright info
//------------------------------------------------------------------------------
// <copyright company="ChaosStudio">
//     Copyright (c) 2002-2010 巧思工作室.  All rights reserved.
//     Contact:		MSN:zhouyu@cszi.com , QQ:478779122
//		Link:				http://www.69sea.com http://www.cszi.com
// </copyright>
//------------------------------------------------------------------------------
#endregion

using log4net;

namespace WinService
{
    /// <summary>
    ///   TaskWindowsService通用服务配置
    /// </summary>
    /// 
    /// <description class = "Task.WinService.ConfigUtility">
    ///   
    /// </description>
    /// 
    /// <history>
    ///   2010-3-12 14:10:15 , zhouyu ,  创建	     
    ///  </history>
    internal class ConfigInfo
    {
        private static readonly ILog logRun = LogManager.GetLogger(typeof (ConfigInfo));
        static ConfigInfo()
        {
            //note:ServiceName必须硬编码, Todo:尝试从外部获得服务信息

            ////Note:此种尝试失败
            //serviceName = ConfigurationManager.AppSettings["service_Name"].Trim();
            //displayName = ConfigurationManager.AppSettings["service_DisplayName"].Trim();
            //description = ConfigurationManager.AppSettings["service_Description"].Trim();
            
            //logRun.DebugFormat(serviceName);
            
            //Note:这种是可用的
            serviceName = "WinService4Tasks";
            displayName = "Common WinServiceForTasks";
            description = "通用服务框架，可在Tasks.config中进行详细的任务配置。";
        }

        //private static readonly XmlDocument xml;

        private static readonly string serviceName;
        private static readonly string displayName;
        private static readonly string description;

        /// <summary>
        /// 服务名称
        /// </summary>
        public static string ServiceName
        {
            get { return serviceName; }
        }

        /// <summary>
        /// 服务显示名称
        /// </summary>
        public static string DisplayName
        {
            get { return displayName; }
        }

        /// <summary>
        /// 服务描述
        /// </summary>
        public static string Description
        {
            get { return description; }
        }

    }
}